<script setup lang="ts">
import { ref,watch } from 'vue'
import $api from '@/api'
import { timeFormat } from '@/utils/time'
const scores=ref([])
function init() {
  const {data}=$api.scores.list()
  watch(data,(_data:Array<any>) =>{
    scores.value=_data
  })
}
init()
</script>

<template>
  <div v-empty="scores.length">
    <div v-for="(item,idx) in scores" :key="item._id"
      w:flex="~ nowrap"
      w:align="items-center"
      w:justify="between"
      w:p="4"
      w:border="b-1 solid gray-100"
    >
      <div>
        <div
          w:text="3xl"
          w:m="b-2"
        >{{item.comment}}</div>
        <div
        
        >{{timeFormat(item.create_date)}}</div>
      </div>
      <div
        w:text="3xl"
      >
        <span>{{item.type==1?'＋':'－'}}</span>
        <span>￥{{item.score}}</span>
      </div>
    </div>
  </div>
</template>

<style scoped lang="scss">

</style>

<route>
{
  meta: {
    title: '积分明细',
    auth: true
  }
}
</route>